package com.yitianyigexiangfa.dubbo;

import com.yitianyigexiangfa.dubbo.entity.Book;
import com.yitianyigexiangfa.dubbo.entity.Person;

/**
 * @author Bill Lau
 * @date 2018-03-27
 */
public class BookServiceImpl implements IBookService{

    @Override
    public String getBooks() {
        return "孵化皮克斯";
    }

    @Override
    public Book getBookById(int id) {
        Book book = new Book();
        book.setId(id);
        book.setName("硅谷钢铁侠");
        Person owner = new Person();
        owner.setId(1);
        owner.setName("张三");
        return book;
    }

    @Override
    public Book getBookByPerson(Person person) {
        Book book = new Book();
        book.setId(1);
        book.setName("追风筝的人");
        book.setOwner(person);
        return book;
    }
}
